<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Xppass Administrator's Control Panel</title>
<LINK href="<?php echo $www_site_url?>/public/yav-style.css" type=text/css rel=stylesheet>
<script src="<?php echo $www_site_url?>/public/js/common.js" type="text/javascript"></script>
<script src="<?php echo $www_site_url?>/public/js/ajax.js" type="text/javascript"></script>
<script src="<?php echo $www_site_url?>/public/js/calendar.js" type="text/javascript"></script>
<script type="text/javascript" src="<?php echo $www_site_url?>/public/js/swfobject.js"></script>
<script>
function getStore(c_id){
	var url = "<?php echo $www_site_url?>/admin.php?action=corporation&view=ajaxstore&c_id="+c_id;

	mini.ajax.get(url, function(r){

		var r = eval('(' + r + ')');

		if(r.s==200){
			var obj = eval('(' + r.d + ')');
			var selobj = $('store_container');
			selobj.options[0] = new Option('--','');

			for(var i in obj){
				i++;
				selobj.options[i]=new Option(obj[i].cs_abbr+' '+obj[i].cs_name, obj[i].cs_id) //add a new option to the end of SELECT
			}

		}
		if(r.s==400){
			$('msg').innerHTML = r.m;
		}
	});

	return false;
}
</script>
</head>
<body><div id="append"></div>
<div id="msg" style="color:red;text-align:center"></div>

	<div class="container">

			<div id="tabs">

				<div id="tabs_mainbox" class="tabs_mainbox" >
					<div class="main" id="tabs_main" >

							<form action="<?php echo $www_site_url?>/admin.php" method="GET">
							<input type="hidden" name="action" value="chart">
							<input type="hidden" name="view" value="comment">
							<table width="100%" border="0">
								<tr>
									<td><?php echo lang('c_title')?>:</td>
									<td align="left"><select name="c_id" onchange="getStore(this.options[this.selectedIndex].value);">
							<option value="">--</option>
							<?php if(isset($corps)){
								foreach ($corps as $v){?>

							<option value="<?php echo $v['c_id'];?>"  <?php if($v['c_id']==$con['c_id']) echo 'selected';?> ><?php echo $v['c_initial']." ". $v['c_title'];?></option>
							<?php }
							}
							?>
							</select></td>
									<td><?php echo lang('cs_name')?>:</td>
									<td align="left"><select id="store_container" name="cs_id">
							<option value="">--</option>
							<?php if(isset($stores) && is_array($stores)){
								foreach ($stores as $v){?>
}
							<option value="<?php echo $v['cs_id'];?>"  <?php if($v['cs_id']==$con['cs_id']) echo 'selected';?> ><?php echo $v['cs_name'];?></option>
							<?php }
							}?>
							</select></td>


									<td rowspan="2"><input type="submit" value="<?php echo lang('submit')?>" class="button" /></td>
								</tr>
								<tr>
									<td align="right"><?php echo lang('a_sdate')?>:</td>

									<td colspan="4" align="left"><input type="text" name="a_sdate" onclick="showcalendar();" value="<?php echo $con['sdate']?>" class="textfield" /> <?php echo lang('to')?> <input type="text" name="a_edate" onclick="showcalendar();" value="<?php echo $con['edate']?>" class="textfield" /></td>

								</tr>
							</table>
							</form>

				</div>
			</div>

		</div>

		<div class="mainbox">


    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="table2LeftBorder"></td>
        <td>
        <!--startprint1-->
        <?php if(isset($assignments['records'])){
        	foreach ($assignments['records'] as $a){ ?>
        <table width="100%" border="0" cellpadding="0" cellspacing="1" class="missionReport">
          <tr>
            <td colspan="2" bgcolor="#9F0000" class="title"><font color="#FFFFFF"><?php echo $a['a_title']?> （ <?php echo substr($a['a_fdate'],0,10);?> ）</font></td>
            <td width="7%" bgcolor="#9F0000" class="title"><font color="#FFFFFF"><?php echo lang("scorenum")?></font></td>
          </tr>
          <?php if(isset($a['comments']) && is_array($a['comments'])){
			foreach ($a['comments'] as $k=>$v) {
          	?>
          <tr>
            <td width="6%" align="left"><?php echo  lang($GLOBALS['gGroups'][$k]);?></td>
            <td width="87%"><span id="br_36"><?php echo join("<br />",$v['content'])?></span></td>
            <td align="center"><?php echo $v['score']?></td>
          </tr>
           <?php
        	}
			}
        ?>
        </table>
         <?php
        	}
        }?>
         <!--endprint1-->
          <br />
           <?php if(!empty( $assignments['pagebar'])){?><div class="pages"><?php echo $assignments['pagebar']; ?></div><?php } ?>
          </td>
        <td class="table2RightBorder"></td>
      </tr>
      <tr>
        <td class="table2BottomLeft"></td>
        <td class="table2Bottom"></td>
        <td class="table2BottomRight"></td>
      </tr>
    </table>


		</div>
</div>

<?php include_once("footer.html")?>
